import { CharacterState, AirState } from "shared/enums/CharacterState"
import { SkillEnum } from "shared/enums/SkillEnum"
/**
 * 测试技能
 */
const testSkill: Ctn.skill.SkillConfig = {
    id: SkillEnum.testSkill,
    anim: "twohandSlash",
    moveType: 'A',
    stopFrame: 30,
    characterState: {
        setAirStates: CharacterState.none,
        life: {
            duration: 35 / 30,
            autoTransfrom: [
                {
                    airStates: AirState.Air,
                    targetStates: CharacterState.FreeFalling,
                }
            ]
        }
    },
    states: [
        {
            trigger: (input) => {
                return input.currentFrame === 0
            },
            turnCtrl: true,
        },
        {
            trigger: (input) => {
                return input.currentFrame === 2
            },
            turnCtrl: false,
        },

        {
            trigger: (input) => {
                return input.currentFrame === 3
                    && input.characterEntity?.humanStates?.airStates === AirState.Air
            },
            veloSet: {
                enable: true,
                // vector: new Vector3(0, 0, -50)
                line: -10
            }
        },
        {
            trigger: (input) => {
                return input.currentFrame === 8
                    && input.characterEntity?.humanStates?.airStates === AirState.Ground
            },
            veloSet: {
                enable: true,
                // vector: new Vector3(0, 0, -50)
                line: -10
            }
        },
        {
            trigger: (input) => {
                return input.currentFrame === 7
            },
            animEffect: {
                followPartName: "Trail"
            }
        },
        {
            trigger: (input) => (input.currentFrame === 10),
            hitDef: {
                /** 火花相对于p2的X坐标偏移量，火花相对于p1的Y坐标偏移量 */
                sparkxy: [-0.5, 4],
                pausetime: 4,
                advFrame: 4,
                hitbox: [0.43, 1.57, 6.14, 2.46],
                g: {
                    frame: 3,
                    line: 4
                },
                a: {
                    frame: 5,
                    line: 30
                }
            }
        },
        {
            trigger: (input) => (input.currentFrame === 14),
            veloSet: {
                enable: false,
            }
        },

        {
            trigger: (input) => (input.currentFrame === 20),
            cancelEnable: {
                [SkillEnum.testSkill]: {
                    enable: true
                }
            }
        },
        {
            trigger: (input) => (input.currentFrame === 30),
            stoped: true
        },
        // {
        //     trigger: (input) => {
        //         return input.currentFrame === 0 && input.characterEntity?.humanStates?.airStates !== AirState.Ground
        //     },
        //     moveCtrl: true,
        //     turnCtrl: true,
        // }
    ]
}
export default testSkill